package com.ypinkj.app.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ypinkj.app.entity.UResumeInfo;
import com.ypinkj.app.entity.UResumeJobhunting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LF
 * @since 2020-09-29
 */
@Mapper
public interface UResumeInfoMapper extends BaseMapper<UResumeInfo> {
    @Update("<script>" +
            "UPDATE u_resume_info" +
            " <set>" +
            " <if test='resumeWork.userid != null'>" +
            "  userid = #{resumeWork.userid}," +
            " </if>" +
            " <if test='resumeWork.jobstatus != null'>" +
            "  jobstatus = #{resumeWork.jobstatus}," +
            " </if>" +
            " <if test='resumeWork.sex != null'>" +
            "  sex = #{resumeWork.sex}," +
            " </if>" +
            " <if test='resumeWork.realname != null'>" +
            "  realname = #{resumeWork.realname}," +
            " </if>" +
            " <if test='resumeWork.workyears != null'>" +
            "  workyears = #{resumeWork.workyears}," +
            " </if>" +
            " <if test='resumeWork.birthday != null'>" +
            "  birthday = #{resumeWork.birthday}," +
            " </if>" +
            " <if test='resumeWork.wechat != null'>" +
            "  wechat = #{resumeWork.wechat}," +
            " </if>" +
            " <if test='resumeWork.email != null'>" +
            "  email = #{resumeWork.email}," +
            " </if>" +
            " <if test='resumeWork.photo != null'>" +
            "  photo = #{resumeWork.photo}," +
            " </if>" +
            " <if test='resumeWork.content != null'>" +
            "  content = #{resumeWork.content}," +
            " </if>" +
            "  updateTime = now()" +
            " </set>" +
            " where id =" +
            " #{resumeWork.id}" +
            " </script>")
    int UpdateUResumeWorkById(@Param("resumeWork") UResumeInfo resumeWork);

    List<UResumeInfo> getList(String userid);
}
